/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package convertmugentojava;

import javax.swing.JTextArea;

/**
 *
 * @author yiori
 */
public class JCTextArea extends JTextArea
{
    private boolean autoScroll = true;

    @Override
    public void append(String str) {
        super.append(str+"\n");
        if (autoScroll)
        {
            setSelectionStart(getText().length());
            setSelectionEnd(getText().length());
        }
    }

    public boolean isAutoScroll() {
        return autoScroll;
    }

    public void setAutoScroll(boolean autoScroll) {
        this.autoScroll = autoScroll;
    }

}
